<extend name="Public:User/base"/>
<block name="content">
    <div class="my-cols-right info-back-color back-margin-padding col-sm-9 col-lg-9">
        <div class="row">
            <div class="small-search col-sm-12 col-lg-12">
                <!-- row-search start -->
                <div class="row">
                    <div class="small-search-a col-sm-6 col-lg-6 text-center">
                        <a class="collect-btn" href="{:U('Home/ReturnInfo/showReturn?returnType=0')}">全部记录</a>
                        <a class="collect-btn" href="{:U('Home/ReturnInfo/showReturn?returnType=1')}">正在退货</a>
                        <a class="collect-btn" href="{:U('Home/ReturnInfo/showReturn?returnType=2')}">已经处理</a>
                    </div>
                </div>
                <!--row-search end-->
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6 col-lg-6"><br>
                <div class="my-select btn-group">
                    <button disabled type="button" class="btn down-select"  style="width:130px;">
                        <if condition="$Think.session.returnTime eq 1">最近一个月
                            <elseif condition="$Think.session.returnTime eq 3"/>最近三个月
                            <elseif condition="$Think.session.returnTime eq 6"/>最近半年
                            <elseif condition="$Think.session.returnTime eq 12"/>最近一年
                            <else/>全部
                        </if>
                    </button>
                    <button type="button" class="btn down-select dropdown-toggle" data-toggle="dropdown">
                        <span class="caret"></span>
                        <span class="sr-only">切换下拉菜单</span>
                    </button>
                    <ul class="dropdown-menu" role="menu">
                        <li><a href="{:U('Home/ReturnInfo/showReturn?returnTime=1')}">最近一个月</a></li>
                        <li><a href="{:U('Home/ReturnInfo/showReturn?returnTime=3')}">最近三个月</a></li>
                        <li><a href="{:U('Home/ReturnInfo/showReturn?returnTime=6')}">最近半年</a></li>
                        <li><a href="{:U('Home/ReturnInfo/showReturn?returnTime=12')}">最近一年</a></li>
                        <li class="divider"></li>
                        <li><a href="{:U('Home/ReturnInfo/showReturn?returnTime=1000')}">全部</a></li>
                    </ul>
                </div>
            </div>
            <div class="col-sm-2 col-lg-2"></div>
            <div class="col-sm-4 col-lg-4" role="form">
                <form action="#" method="post" name="search" role="search">
                    <div class="input-group" style="padding: 10px 50px 0 0;">
                        <label class="sr-only"></label><!--form表单中，label标签必不可少-->
                        <input type="text" maxlength="255" autocomplete="off" class="form-control" placeholder="搜索退货记录" name="returnSearch">
                        <span class="input-group-btn"><input type="submit" value="搜索" class="btn my-btn-default-text my-btn-default-bgcolor btn-default"></span>
                    </div>
                </form>
            </div><!--搜索框表单-->
        </div>
        <!-- table star -->
        <div class="row"  style="margin-left: 30px;">
            <div class="col-sm-12 col-lg-12">
                <div class="mypanel panel panel-default text-center" style="border: none;">
                    <table>
                        <thead>
                        <empty name="returnInfo">
                            没有符合条件的退货信息
                            <else/>
                            <tr class="table-title">
                                <td>退货单号</td>
                                <td colspan="2">退货信息</td>
                                <td>退款金额（元）</td>
                                <td>提交时间</td>
                                <td>状态</td>
                                <td>操作</td>
                            </tr>
                            </empty>
                        </thead>
                        <tbody>

                        <!-- black-row start-->
                        <tr class="black-row">
                            <td colspan="7"></td>
                        </tr>
                        <!-- black-row end -->
                        <foreach name="returnInfo" item="v">
                        <tr class="table-row">
                            <td><a href="#退货详情页面">{$v['returnid']}</a></td>
                            <td colspan="2">
                                <a href="#商品名">{$v['goodsname']}</a><br>
                                <!--<a href="#商品型号">这个是商品型号</a>-->
                            </td>
                            <td>{$v['unitprice']}</td>
                            <td>{$v['applytime']}</td>
                            <if condition="$v.isapplypassed eq 0">
                                <td>待确认</td>
                                <elseif condition="($v.isapplypassed eq 1) AND ($v.receivedtime lt '1971-01-01')"/>
                                <td>退货申请确认，货物发送中</td>
                                <elseif condition="($v.receivedtime gt '1971-01-01') AND ($v.processingtime lt '1971-01-01')"/>
                                <td>正在确认退货</td>
                                <elseif condition="$v.issuccess eq 1"/>
                                <td>收货已确认</td>
                                <elseif condition="$v.issuccess eq 0"/>
                                <td>退货失败，正在退回</td>
                            </if>
                            <td>
                                <button type="button" class="btn button-set"
                                onclick="window.location.href =
                                '{:U('Home/ReturnInfo/detailReturn','returnId='.$v['returnid'].'&& unitprice='.$v['unitprice'].'&& goodsName='.$v[goodsname].'&& returnReason='.$v['returnreason'].'&& applyTime='.$v['applytime'])}' "
                                        >查看</button>
                            </td>
                        </tr>
                        </foreach>
                        <tr class="black-row">
                            <td colspan="7"></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <!-- table end -->
    </div>
</block>

